const { ListToNode, NodeToList, ListNode, timeL } = require("../utils.js");
/**
 * @param {number[]} nums
 * @return {number}
 */
var firstMissingPositive = function (nums) {
  let list = [];
  for (let i = 0; i < nums.length; i++) {
    if (nums[i] > 0) list[nums[i] - 1] = true;
  }
  for (let i = 0; i < list.length; i++) {
    if (!list[i]) return i + 1;
  }
  return list.length + 1;
};
let nums = [1, 2, 0];

timeL(firstMissingPositive, [nums]);
